<template>
  <div class="part_box">
    <div class="title">
      <p>出入监控</p>
      <div>
        <span>出：9999</span>
        <span>入：9999</span>
        <i class="el-icon-arrow-right" @click="openVideo"></i>
      </div>
    </div>
    <div class="device_info">
      {{deviceInfo.name}}&nbsp;&nbsp;&nbsp;&nbsp;
      {{deviceInfo.type === 1 ? '车卡':'道闸'}}&nbsp;&nbsp;&nbsp;&nbsp;
      {{deviceInfo.address === 1?'出口':'入口'}}
    </div>
    <div class="pic_box">
      <carousel :imgs="dataList" @deviceInfo="getCurrent"/>
    </div>
  </div>
</template>

<script>
  import carousel from "./carousel";
  export default {
    components:{
      carousel
    },
    data(){
      return{
        deviceInfo:{},
        dataList:[
          {
            url:'',
            name:'吕岭路蔡塘社2#1201',
            address:1,
            type:1,
            index:0
          },{
            url:'',
            name:'蔡塘社9#1201',
            address:1,
            type:2,
            index:1
          },{
            url:'',
            name:'蔡塘社9#1201',
            address:1,
            type:2,
            index:1
          },{
            url:'',
            name:'蔡塘社1号楼北侧',
            address:2,
            enable:2,
            index:2
          },{
            url:'',
            name:'蔡塘社28#1201',
            address:2,
            enable:1,
            index:3
          },{
            url:'',
            name:'蔡塘社4#1201南侧',
            address:2,
            enable:2,
            index:4
          },{
            url:'',
            name:'蔡塘社7#1201',
            address:1,
            enable:2,
            index:5
          },{
            url:'',
            name:'蔡塘社4#1201南侧',
            address:2,
            enable:2,
            index:6
          },{
            url:'',
            name:'蔡塘社7#1201',
            address:1,
            enable:2,
            index:7
          },{
            url:'',
            name:'蔡塘社7#1205',
            address:1,
            enable:2,
            index:8
          },
        ],
        // isPop:false,
      }
    },
    mounted() {
      this.getCurrent(0);
    },
    methods:{
      getCurrent(e){
        this.deviceInfo = e;
      },
      openVideo(){
        this.$emit('listenToVideo',true)
      }
    }
  }
</script>


<style scoped>
  .part_box {
    width: 100%;
    box-sizing: border-box;
    background: rgba(83, 255, 197, 0.05);
    border-radius: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    overflow: hidden;
  }

  .title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding:0 10px 0 2px;
    background: linear-gradient(to right, #113140,#11293D);
  }

  .title p {
    font-weight: bold;
    font-size: 14px;
    width: 50%;
    line-height: 28px;
    position:relative;
    padding-left: 8px;
    box-sizing: border-box;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    text-shadow: 0 6px 8px rgba(0, 0 ,0 ,0.5);
    background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#53FFC5));
    background: linear-gradient(180deg, #FFFFFF 0%, #53FFC5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #FFFFFF;
  }

  .title p::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 28px;
    width: 9px;
    /*background: url("../../../../assets/image/")no-repeat center;*/
    background-size: 100% 100%;
  }

  .title div{
    display: flex;
    align-items: center;
  }

  .title div span {
    color: #53FFC5;
    font-size: 12px;
  }

  .title div span:nth-child(2) {
    margin: 0 5px 0 10px;
  }

  .title i {
    cursor: pointer;
    color: #53FFC5;
    font-size: 12px;
  }

  .pic_box{
    width: 100%;
    margin-top: 18px;
  }

  .pic_box img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
  }

  .device_info{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #D6FFEC;
    font-size: 12px;
    text-align: center;
    font-family: Alibaba-PuHuiTi-R, Alibaba-PuHuiTi;
  }

</style>
